package com.larissa.android.quiz;

import androidx.lifecycle.ViewModel;

import java.util.List;

public class QuestionViewModel extends ViewModel {
    private int currentIdx;

    private Question[] questions={
            new Question(R.string.test_bj,true),
            new Question(R.string.test_dc,false),
            new Question(R.string.test_london,true),
            new Question(R.string.test_tokyo,true)
    };

    public Question getQuestion(){
        return questions[currentIdx];
    }

    public void saveQuestion(boolean answer){
        questions[currentIdx].setQuestionAnswer(answer);
    }

    public boolean getPrevQuestion(){
        if(currentIdx==0) return false;
        currentIdx-=1;
        return true;
    }

    public boolean getNextQuestion(){
        if(currentIdx==questions.length-1) return false;
        currentIdx+=1;
        return true;
    }


}
